package com.chif.goingplus.service;

import com.chif.goingplus.dao.OriginMapper;
import com.chif.goingplus.pojo.Origin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OriginServiceImpl implements OriginService {

    @Autowired
    private OriginMapper originMapper;


    @Override
    public List<Origin> queryAllOrigin() {
        return originMapper.queryAllOrigin();
    }

    @Override
    public Origin queryOriginById(int id) {
        return originMapper.queryOriginById(id);
    }

    @Override
    public int addOrigin(Origin origin) {
        originMapper.addOrigin(origin);
        return origin.getOriid();
    }

    @Override
    public int updateOrigin(Origin origin) {
        return originMapper.updateOrigin(origin);
    }

    @Override
    public int deleteOriginById(int id) {
        return originMapper.deleteOriginById(id);
    }
}
